﻿using System;
using System.Linq;
using System.Collections.Generic;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
using NakedObjects;
using NakedObjects.Services;


namespace HRMDomain
{
    [DisplayName("Admin")]
    public class AdminRepository : AbstractFactoryAndRepository
    {
        #region Injected Services
        // This region should contain properties to hold references to any services required by the
        // object.  Use the 'injs' shortcut to add a new service.

        #endregion

        public void CreateNewAbsenceStage(string Name)
        {
            AbsenceStageType obj = Container.NewTransientInstance<AbsenceStageType>();
            obj.Name = Name;
            Container.Persist(ref obj);
            Container.InformUser("Absence Stage Added.");

        }

        public void CreateNewEmployeeClass(string Name)
        {
            EmployeeClassType obj = Container.NewTransientInstance<EmployeeClassType>();
            obj.Name = Name;
            Container.Persist(ref obj);
            Container.InformUser("Employee Class Added.");

        }

        public void CreateNewFeedbackCategory(string Name)
        {
            FeedbackCategory obj = Container.NewTransientInstance<FeedbackCategory>();
            obj.Name = Name;
            Container.Persist(ref obj);
            Container.InformUser("Feedback Category Added.");

        }

        public void CreateNewPerformanceCategory(string Name)
        {
            PerformanceCategory obj = Container.NewTransientInstance<PerformanceCategory>();
            obj.Name = Name;
            Container.Persist(ref obj);
            Container.InformUser("Performance Category Added.");

        }

        public void CreateNewPerformanceOutcome(string Name)
        {
            PerformanceOutcome obj = Container.NewTransientInstance<PerformanceOutcome>();
            obj.Name = Name;
            Container.Persist(ref obj);
            Container.InformUser("Performance Outcome Added.");

        }

        public void CreateNewInjuryCategory(string Name)
        {
            InjuryCategory obj = Container.NewTransientInstance<InjuryCategory>();
            obj.Name = Name;
            Container.Persist(ref obj);
            Container.InformUser("Injury Category Added.");

        }

        public void CreateNewInjuryType(string Name)
        {
            InjuryType obj = Container.NewTransientInstance<InjuryType>();
            obj.Name = Name;
            Container.Persist(ref obj);
            Container.InformUser("Injury Type Added.");

        }

    }
}
